<template>
<div>
  <div><div>组织名称: <input type="text"> <van-button>查询</van-button> <van-button>搜索</van-button></div></div>
  <div><van-button>新增</van-button> &ensp;&ensp;&ensp;<van-button @click="exportd">导出</van-button> &ensp;&ensp;&ensp;&ensp;<van-uploader :after-read="updalod"></van-uploader></div>
  <el-tree :data="list" :props="defaultProps" ></el-tree>
</div>
</template>

<script>
export default {
name: "Organization",
  data(){
  return{
    list:[]
  }
  },
  methods:{
    exportd:function (){
      this.myaxios("http://192.168.0.28:5000/download",'get',{})
      .then(res=>{
        console.log(res)
      })
    },
    updalod(file){
      console.log(file.file)
      let data=new FormData()
      data.append("file",file.file)
      console.log(data)
      const axiosInstance = this.axios.create({withCredentials: false});
      axiosInstance({
        method: "post",
        url: "http://192.168.0.28:5000/upload",
        data: data
      }).then(res=>{
        console.log(res)
      })
    },
    get_data(){
      this.myaxios("http://192.168.0.28:5000/acporgn",'get',{})
          .then(res=>{
            console.log(res)
            this.list=res.data.list1
            console.log(this.list)
          })
    }
  },
  mounted() {
this.get_data()
  }
}
</script>

<style scoped>

</style>
